package com.eastedu.report.common.util;

import com.eastedu.report.common.model.parameter.ReportGenerateParameter;
import com.eastedu.utils.DateUtil;

import java.util.Map;

/**
 * The interface Report util.
 *
 * @author superman
 */
public interface ReportUtil {
    /**
     * Fill common report data.
     *
     * @param data              the data
     * @param generateParameter the generate parameter
     */
    static void fillCommonReportData(Map<String, Object> data, ReportGenerateParameter generateParameter) {
        Integer dateCode = generateParameter.getDateCode();
        data.put("term_info", DateUtil.convertTermToSchoolYear(String.valueOf(generateParameter.getCodeType().toTerm(dateCode))));
        data.put("section_code", generateParameter.getSection());
        data.put("school_name", generateParameter.getSchoolName());
        data.put("report_time", "统计时间：" + DateUtil.getFirstDayOfMonth(dateCode + "") + " ~ " + DateUtil.getLastDayOfMonth(dateCode + ""));
    }
}
